<?php
require_once('./admin/connexion.php');
require ('./func.req.php');
if ($install) {
    ?>
    <link rel="stylesheet" type="text/css" href="./css/style.css" title="" media="all" />
    <div id="box" onclick="document.getElementById('box').style.display='none';" style="margin:20%;" class="error-box rounded" title="Fermer la fen&ecirc;tre">
        L'installation n'a pas encore &eacute;t&eacute; r&eacute;alis&eacute;e. <a href="./install/index.php">Cliquez ici</a> pour commencer.
    </div>
    <?php
} else {
    require('./config/tbl.php');
    if ($line_info['maintenance_choix_info'] == "Oui") {
        show_maintenance();
    } else {

        /*
          -----------------------------------
          ---- SCRIPT D'AUTHENTIFICATION ----
          FujiCraft V3.0
          By Fujido
          Contact : thefujido@gmail.com
          -----------------------------------
         */

        session_start(); // On relaye la session
        if (@session_is_registered("authentification")) { // v�rification sur la session authentification (la session est elle enregistr�e ?)
// ici les �ventuelles actions en cas de r�ussite de la connexion
        }
// GESTION DE LA D�connexion
        if (isset($_GET['erreur']) && $_GET['erreur'] == 'logout') { // Test sur les param�tres d'URL qui permettront d'identifier un "contexte" de d�connexion
            $prenom = $_SESSION['prenom']; // On garde le pr�nom en variable pour dire au revoir (soyons polis :-)
            @session_unset("authentification");
            header("Location:login.php?erreur=logout");
        }
        ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title><?php echo $site; ?> | L'&eacute;quipe</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <meta http-equiv="Content-Style-Type" content="text/css" />
                <meta http-equiv="content-language" content="fr,en" />
                <link rel='shortcut icon' type="image/x-icon" href='./images/favicon.ico' />
                <link rel="stylesheet" type="text/css" href="./css/style.css" title="" media="all" />
                <link rel="stylesheet" type="text/css" href="./css/news.css" title="" media="all" />
                <script type="text/javascript" src="./js/news.js"></script>
            </head>
            <body>
                <div id="block">
                    <div id="contentblock">
                        <div class="wrapper">
                            <?php
                            show_header();
                            show_menu();
                            show_newsbox();
                            show_userbox();
                            //Selection de la table
                            $query = "SELECT * FROM " . $database . "." . $tb_team . "";
                            //Affichage de la selection
                            $result = @mysql_query($query) OR DIE("Erreur de la s&eacute;lection des utilisateurs : " . mysql_error());
                            $result_admin = @mysql_query($query) OR DIE("Erreur de la s&eacute;lection des utilisateurs : " . mysql_error());
                            $result_modo = @mysql_query($query) OR DIE("Erreur de la s&eacute;lection des utilisateurs : " . mysql_error());
                            $line = @mysql_fetch_assoc($result);
                            ?>
                            <div class="mainbox">
                                <h2>L'&eacute;quipe</h2>
                                <br />
                                <img src="./images/team/dev.png" alt="D&eacute;veloppeurs" /><br />
                                <br />
                                <fieldset>
                                    <legend><a href="./user.php?user=fujido" title="Consulter son profil"><b>Fujido</b></a></legend>
                                    <img src="./images/team/fujido.png" alt="" width="100" height="100" style="float:left;border:1px solid navy;margin-right:5px;" />
                                    Il ne joue pas sur se serveur, mais il est le d&eacute;veloppeur de se site, le CMS <a href="http://fujicraft.no-ip.org/" target="_BLANK"><b><u>FujiCraft</u></b></a> <br />
                                    <br />
                                    &Acirc;g&eacute; de 18 ans, il est &eacute;tudiant en informatique et vie en Suisse &agrave; Bienne. <br />
                                </fieldset>
                                <br />
                                <?php
                                if (mysql_num_rows($result) == 0) {
                                    
                                } else {
                                    if ($line['rang_team'] == "admin") {
                                        ?>
                                        <img src="./images/team/admin.png" alt="Administrateurs" /><br />
                                        <br />
                                        <?php
                                        while ($admin = mysql_fetch_assoc($result_admin)) {
                                            ?>
                                            <fieldset>
                                                <legend><a href="./user.php?user=<?php echo $admin['pseudo_team']; ?>" title="Consulter son profil"><b><?php echo $admin['pseudo_team']; ?></b></a></legend>
                                                <img src="./images/team/<?php echo $admin['pseudo_team']; ?>.png" alt="" width="100" height="100" style="float:left;border:1px solid navy;margin-right:5px;" />
                                                <?php echo addChar(utf8_encode($admin['fonction_team'])); ?><br />
                                                <br />
                                                <?php echo addChar(utf8_encode($admin['description_team'])); ?><br />
                                                <br />
                                            </fieldset>
                                            <br />
                                            <br />
                                            <?php
                                        }
                                    } else if ($line['rang_team'] == "modo") {
                                        ?>
                                        <img src="./images/team/mod.png" alt="Mod&e&eacute;rateurs" /><br />
                                        <br />
                                        <?php
                                        while ($modo = mysql_fetch_assoc($result_modo)) {
                                            ?>
                                            <fieldset>
                                                <legend><a href="./user.php?user=<?php echo $modo['pseudo_team']; ?>" title="Consulter son profil"><b><?php echo $modo['pseudo_team']; ?></b></a></legend>
                                                <img src="./images/team/<?php echo $modo['pseudo_team']; ?>.png" alt="" width="100" height="100" style="float:left;border:1px solid navy;margin-right:5px;" />
                                                <?php echo addChar(utf8_encode($modo['fonction_team'])); ?><br />
                                                <br />
                                                <?php echo addChar(utf8_encode($modo['description_team'])); ?><br />
                                                <br />
                                            </fieldset>
                                            <br />
                                            <br />
                                            <?php
                                        }
                                    }
                                }
                                ?>
                            </div>
                            <?php show_footer(); ?>
                        </div>
                    </div> 
                </div>
            </body>
        </html>
        <?php
    }
}
?>